<template>
	<m-block gap="14 24" spa="20 0 " className="flex-between">
		<m-text ftsize="28" weight="700">遇到问题？</m-text>
		<view class="flex">
			<button class="server-btn " open-type="contact" type="default" @click="openServiceChat" hover-class='none' >
				<m-icon bgColor="#f6f6f6" wh="56" type="wx1" spa="0 25 0 20" ></m-icon>
			</button>
			<m-icon wh="56" type="dh" @click="makePhoneCall(ptkefu)"></m-icon>
		</view>
	</m-block>
</template>

<script>
	import { mapState } from 'vuex'
	export default {
		name: "m-service",
		props: {
			shopId: {
				type: [Number, String],
				default: 0
			},
		},
		computed: {
			...mapState({
				userinfo: state => state.user.userinfo,
				config: state => state.general.config,
			}),
			ptkefu() {
				return Number(this.config[704])
			},
		},
		data() {
			return {

			};
		},
		methods: {
			goShopChat() {
				if (this.uId == this.ptkefu) {
					return this.Jump('/pages/chat/list')
				}
				this.Jump({
					url: '/pages/chat/chat',
					params: {
						touid: this.ptkefu,
						touserName: '商家客服'
					}
				})
			},
			goPtChat() {
				if (this.uId == this.ptkefu) {
					return this.Jump('/pages/chat/list')
				}
				this.Jump({
					url: '/pages/chat/chat',
					params: {
						touid: this.ptkefu,
						touserName: '平台客服'
					}
				})
			},
		},
	}
</script>

<style lang="scss">
	
	.server-btn{
		
		padding: 0 !important;
		margin: 0 !important;
		border-width: 0 !important;
		border-color: unset !important;
		background: unset !important;
		line-height: 0 !important;
		cursor: not-allowed !important;
		border-image: initial;
		&::after {
			display: none;
		}
	}
</style>